import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "Home",
    component: () => import('@/views/home/index.vue'),
  },
  // 替代vue2中的'*'通配符路径
  { 
    path: '/:pathMatch(.*)*', 
    redirect: '/' 
  },
]

const router = createRouter({
  history: createWebHashHistory(), // history 模式则使用 createWebHistory()
  routes,
});

export default router;
